#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	FILE* pf = fopen("date.txt", "w");
	if (pf == NULL)
	{
		perror("fopen_date");
		return 1;
	}
	fputs("hello world!\n", pf);
	fputs("Earth,why are you so pretty!\n", pf);
	fputs("You gave brith to us,you are the mom of the whole world ,we should take good care of you.\n", pf);
	fputs("our world!\n", pf);
	fclose(pf);
	pf = NULL;
    pf = fopen("date.txt", "r");
	FILE* cf = fopen("date_copy.txt", "w");
	if (pf == NULL&&cf ==NULL)
	{
		perror("fopen");
		return 1;
	}
	char ch = 0;
	while ((ch = fgetc(pf)) != EOF)
	{
		fputc(ch, cf);
	}
	fclose(pf);
	fclose(cf);
	pf = NULL;
	cf = NULL;
	return 0;
}